package com.example.springboot.controller;

import cn.hutool.core.util.StrUtil;
import com.example.springboot.common.AuthAccess;
import com.example.springboot.common.Result;
import com.example.springboot.entity.User;
import com.example.springboot.service.IUserService;
import com.example.springboot.utils.CodeUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * 功能：提供接口返回数据
 */
@RestController
public class GenerateCodeController {

    @Autowired
    private IUserService userService;

    @AuthAccess
    @GetMapping("/generate")
    public Result generate(@RequestParam String tableName) {
        try {
            CodeUtils.generate();
            return Result.success("代码生成成功，请配置前端路由，文件名为:..,.....");
        } catch (Exception e) {
            return Result.error(e.getMessage());
        }
    }
}
